<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : da_100_01E.jsp
    Description : 공지/이벤트 리스트(영문)
    author Seung Hun
    since 2012. 7. 20.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 7. 20.     Seung Hun     최초 생성
--%>
<%@ include file="/WEB-INF/jsp/co/us/include/declare.jspf" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Notice&Event &#124; HMC CSR</title>
<meta name="description" content="This page provides the news, announcements, and latest updates regarding HMC’s CSR activities." />
<meta name="keywords" content="HMC CSR, News and Notification, events, bulletin board" />
<%@ include file="/WEB-INF/jsp/co/us/include/header.jspf" %>
<link rel="stylesheet" type="text/css" href="/css/usr/eng.css" media="screen" />
<script type="text/javaScript" language="javascript">
<!--
$(document).ready(function() {
    /* form validation check */
    onloadCharCheck();
    
    $("#srchButn").bind("click", moveSearch);    // 검색
    $("#srchTxt").bind("keydown", eventEnter);    // 엔터키 제어
    
});

/*
 * 페이징 
 */
function movePage(num) {
    $("#currentPageNo").val(num);
    $("#mainForm").attr('action','/da_100_01.do').submit();
}

/*
 * 검색
 */
function moveSearch() {
    
    if (!isSchrChk($("#srchTxt").val())) {
        alert("Results will not be able to enter special characters.");
        $("#srchTxt").focus();
        return false;
    }
    
    if($("#srchTxt").val().length == 0) {
        alert("Please Insert Search Word.");
        $("#srchTxt").focus();
        return false;
    }
    
    $("#currentPageNo").val("1");
    $("#mainForm").attr('action','/da_100_01.do').submit();
}

/*
 * 검색어 조건 세팅
 */
function scnSearch(argSrch) {
    
    $("#srchScn").val(argSrch);
}

/*
 * 검색
 */
function blbSearch() {
    
    $("#srchTxt").val("");
    $("#srchScn").val("");
    
     $("#currentPageNo").val("1");
    $("#mainForm").attr('action','/da_100_01.do').submit();
}

/*
 * 상세보기
 */
function moveDtlPage(argIdx, argBlbCd){
    
    $("#idx").val(argIdx);
    $("#blbCd").val(argBlbCd);
    
    $("#mainForm").attr('action','/da_100_02.do').submit();
}

/*
 * 검색 Text EnterKey 처리
 */
function eventEnter() {
    if (event.key == 13) {
        moveSearch();
    }
}

//-->

</script>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/us/include/topE.jsp" %>
    <!-- top -->

    <!-- container -->
    <div id="container">
        <div id="contentsWrap">
            <div id="contentsArea">
                <div class="headingArea">
                    <h2>NOTICE &amp; EVENT</h2>
                </div> 
                <form id="mainForm" name="mainForm" method="post" onsubmit="">
                    <input type="hidden" id="idx" name="idx" value="" />
                    <input type="hidden" id="blbCd" name="blbCd" value="" />
                    <input type="hidden" id="currentPageNo" name="currentPageNo" value="${paginationInfo.currentPageNo}" />
                    <input type="hidden" id="mlgScnCd" name="mlgScnCd" value="KO" />
                    <input type="hidden" id="CSR_LOCALE_PARAM" name="CSR_LOCALE_PARAM" value="en" />
                <div id="contetns">
                    <div class="location">
                        <a href="/ma_100_01.do">Home</a>
                        <a href="/da_100_01.do">CSR Materials</a>
                        <span>Notice &amp; Event</span>
                    </div>
                    <div class="searchArea">
                        <p class="pageResult"> <span class="totalNum">${paginationInfo.totalRecordCount}</span> posts in total, Current Page: <span>${paginationInfo.currentPageNo}/${paginationInfo.totalPageCount}</span> </p>
                        <div id="search">
                            <fieldset>
                                <legend class="invisible">Search</legend>
                                <div class="selectArea">
                                    <select id="srchBlbCd" name="srchBlbCd" onChange="blbSearch();">
                                        <option value="">Sort</option>
                                        <option value="1" <c:if test="${rqInfo.srchBlbCd == '1' }">selected</c:if> >Notice</option>
                                        <option value="2" <c:if test="${rqInfo.srchBlbCd == '2' }">selected</c:if> >Event</option>
                                    </select>
                                </div>
                                <div class="selectArea">
                                    <select id="srchScn" name="srchScn">
                                        <option value="">All</option>
                                        <option value="title" <c:if test="${rqInfo.srchScn == 'title' }">selected</c:if> >Title</option>
                                        <option value="contents" <c:if test="${rqInfo.srchScn == 'contents' }">selected</c:if> >Contetns</option>
                                    </select>
                                </div>
                                <input type="text" class="formSearch" id="srchTxt" name="srchTxt" onClick="return false;" value="${rqInfo.srchTxt }" title="검색어입력" minbyte="2" maxlength="10"  /><input type="image" id="srchButn" onClick="return false;" src="/img/usr/eng/btn/btn_search_font.gif" title="search" alt="search" />
                            </fieldset>
                        </div>
                    </div>
                    <table border="1" class="tableList" summary="NO.,Type,Subject, Last Updated, View Count">
                        <colgroup>
                            <col width="8%" />
                            <col width="12%" />
                            <col width="50%" />
                            <col width="15%" />
                            <col width="15%" />
                        </colgroup>
                        <thead>
                            <tr>
                                <th>NO.</th>
                                <th>Type</th>
                                <th>Subject</th>
                                <th>Last Updated</th>
                                <th>View Count</th>
                            </tr>
                        </thead>
                        <tbody>
                            <c:choose>
                                <c:when test="${resultList != null && !empty resultList }">
                                    <c:forEach var="result" items="${resultList }" varStatus="status">
                            <tr>
                                <td class="num"><input type="hidden" id="arrIdx" name="arrIdx" value="${result.idx}" />${result.blcNo }</td>
                                <td><input type="hidden" id="arrBlbCd" name="arrBlbCd" value="${result.blbCd}" />${result.blbNm }</td>
                                <c:if test="${fn:length(result.titl) > 30 }">
                                <td class="dirLeft"><input type="hidden" id="arrTitl" name="arrTitl" value="${result.titl}" /><a href="#none" id="arrA" onclick="moveDtlPage('${result.idx}', '${result.blbCd }');return false;">${fn:substring(result.titl,0,30) }...</a></td>
                                </c:if>
                                <c:if test="${fn:length(result.titl) <= 30 }">
                                <td class="dirLeft"><input type="hidden" id="arrTitl" name="arrTitl" value="${result.titl}" /><a href="#none" id="arrA" onclick="moveDtlPage('${result.idx}', '${result.blbCd }');return false;">${result.titl }</a></td>
                                </c:if>
                                <td class="num">${result.rgstDt}</td>
                                <td class="num">${result.iqNo }</td>
                            </tr>
                                    </c:forEach>
                                </c:when>
                                <c:otherwise>
                            <tr>
                                <td colspan="5">No Contents.</td>
                            </tr>
                                </c:otherwise>
                            </c:choose>
                        </tbody>
                    </table>
                    <div class="pageNate">
                        <able:pagination paginationInfo="${paginationInfo }" type="image" jsFunction="movePage" />
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
    <!-- /container -->


    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/us/include/bottomE.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>